package parameter

import (
	"gf-assistant/internal/common"
	"github.com/gogf/gf/v2/frame/g"
)

type GetRoleRes struct {
	RoleId           uint   `json:"roleId" dc:"角色ID"`
	RoleName         string `json:"roleName" dc:"角色名称"`
	Remark           string `json:"remark" dc:"备注"`
	EnableStatus     uint   `json:"enableStatus" dc:"状态,1-有效，0-无效"`
	EnableStatusName string `json:"enableStatusName" dc:"状态名称"`
	CreatedUserName  string `json:"createdUserName" dc:"创建人"`
	CreatedTime      string `json:"createdTime" dc:"创建时间"`
	UpdatedTime      string `json:"updatedTime" dc:"修改时间"`
	UpdatedUserName  string `json:"updatedUserName" dc:"修改人"`
}

type ListRoleReq struct {
	g.Meta       `path:"/list" method:"post"`
	RoleName     string `json:"roleName" dc:"角色名称，模糊搜索"    `
	EnableStatus int    `json:"enableStatus"  d:"-1" dc:"有效状态：1-有效，0-无效，（-1）-全部"`
	common.CommonPaginationReq
}

type ListRoleRes struct {
	Detail []*GetRoleRes `json:"detail" description:"列表"`
	Total  int64         `json:"total" description:"数据总数"`
}

type SaveRoleReq struct {
	g.Meta     `path:"/save" method:"post"`
	RoleId     uint   `json:"roleId"  dc:"角色Id"`
	RoleName   string `json:"roleName"  v:"required#角色名必填" dc:"角色名称"`
	Remark     string `json:"remark" v:"" dc:"备注"`
	MenuIds    []uint `json:"menuIds" v:"" dc:"权限ID"`
	operatorId uint
}

func (s *SaveRoleReq) SetOperatorId(operatorId uint) {
	s.operatorId = operatorId
}
func (s *SaveRoleReq) GetOperatorId() uint {
	return s.operatorId
}

type SaveRoleRes struct {
	RoleId uint `json:"roleId" dc:"角色ID"`
}

type DeleteRoleReq struct {
	g.Meta     `path:"/delete" method:"post"`
	RoleId     uint `json:"roleId" v:"required#角色Id必填" dc:"角色Id"`
	operatorId uint
}

func (s *DeleteRoleReq) SetOperatorId(operatorId uint) {
	s.operatorId = operatorId
}
func (s *DeleteRoleReq) GetOperatorId() uint {
	return s.operatorId
}

type DeleteRoleRes struct {
}
